Repository navigation
scripts: Fix portability issues in asmap-verify (BSD diff and GPG) - #76
Open
AlphaSparrow wants to merge 1 commit into
Open
AlphaSparrow wants to merge 1 commit into
AlphaSparrow wants to merge 1 commit into
Conversation
jurraca
approved these changes
Oct 8, 2026
jurraca
left a comment
Collaborator
There was a problem hiding this comment.
Nice, thanks. Tested and confirmed behavior on Linux.
Would've been better as two commits but not a big deal in this case.
Would like some Mac users to test and confirm.
hodlinator
reviewed
Oct 9, 2026
Comment on lines
+39
to
+40
| # shellcheck disable=SC2206 | ||
| GPG_ARRAY=($GPG) |
Contributor
There was a problem hiding this comment.
https://www.shellcheck.net/wiki/SC2206 indicates this is just in order to avoid having to add quotes. Is there some reason quotes would not work here? Opting for the comment instead seems more verbose.
Suggested change
| # shellcheck disable=SC2206 | |
| GPG_ARRAY=($GPG) | |
| GPG_ARRAY=("$GPG") |
hodlinator
approved these changes
Oct 17, 2026
hodlinator
left a comment
Contributor
There was a problem hiding this comment.
ACK 6dd482a
Would prefer if the commits were squashed.
- Use BSD/POSIX-compatible 'diff -s' instead of GNU-only 'diff --report-identical' so asmap-verify works on macOS/BSD. - Allow overriding the GPG binary via the GPG environment variable (defaulting to 'gpg') to support systems using gpg2 or custom paths. Co-authored-by: hodlinator <172445034+hodlinator@users.noreply.github.com>
AlphaSparrow
force-pushed
the
fix-asmap-verify-portability
branch
from
October 17, 2026 14:45
6dd482a to
9532c86
Compare
Author
|
Squashed into a single commit (no functional changes). |
hodlinator
approved these changes
Oct 17, 2026
hodlinator
left a comment
Contributor
There was a problem hiding this comment.
re-ACK 9532c86
Thanks for the squash!
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses two portability issues in
asmap-verifyto improve compatibility across environments:Replace GNU-specific
diff --report-identicalwithdiff -sThe script currently uses the long flag
--report-identical, which is not supported by the default BSDdifffound on macOS and FreeBSD (resulting in an "illegal option" error). It has been replaced with the equivalent short flag-s, which is supported natively across BSD, macOS, and GNU environments while preserving the identical file output logging.Respect
$GPGenvironment variable overridesCurrently,
asmap-verifyhardcodes thegpgbinary, which causes failures for users whose package managers (e.g., Homebrew) install GnuPG v2 asgpg2. This PR brings the logic into alignment withasmap-attestby defaulting togpgbut respecting the$GPGenvironment variable, safely parsing it for tool validation.